<template>
<div> 
    学生姓名:{{stuName}}
        年龄:{{age}}
<button @click="sendStudentName">点击我将学生名称传递给app</button>
<button @click="offEvent">解绑事件</button>
    
</div>
</template>

<script>


   export default {
        name:'Student',
       
        data(){
       
            return{
          stuName:"李彤康",
          age:18
            }
        },
        components: {},
        methods:{
        sendStudentName(){
            this.$emit('test1',this.stuName,333,344,432);
            this.$emit('test2')
        },
        offEvent(){
            this.$off('test1')  //解绑一个自定义事件
           this.$off(['test1','test2'])
          // this.$off()//解绑所有自定义事件
        }
   }
}
</script>

<style scoped>

</style>